package com.example.demo1107.demo1;

public class Singleton03 {
    private Singleton03(){}
    private static Singleton03 singleton;
    public static Singleton03 getInstance(){
        if (singleton==null){
            synchronized (Singleton03.class){
            if (singleton==null){
                singleton=new Singleton03();
                }
            }
        }
        return singleton;
    }
    public void show(){
        System.out.println("-----------show---------");
    }
}
